from ultralytics import YOLO

if __name__ == '__main__':
    model = YOLO(model=r'D:\Traffic_intersection\Road_defects\ultralytics-main\ultralytics\cfg\models\11\yolo11.yaml')
    model.load('yolo11n.pt')
    # model = YOLO(model=r'D:\Traffic_intersection\Road_defects\ultralytics-main\runs\detect\train\weights\last.pt')
    model.train(data=r'D:\Traffic_intersection\Road_defects\ultralytics-main\mydata.yaml',
                imgsz=640,
                epochs=10,
                batch=4,
                device=0,
                lr0=0.001,
                lrf=0.1,
                optimizer='Adam',
                close_mosaic=10,
                flipud=0.5,  # 添加垂直翻转参数
                fliplr=0.5  # 添加水平翻转参数
                )





